<%@page import="drukarnia.model.PriceForMaterials"%>
<%@page import="drukarnia.controller.PriceForMaterialsManager"%>

<%@page import="java.util.List"%>
<%@page import="drukarnia.model.User"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ page errorPage="WEB-INF/bledy.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Drukarnia</title>
</head>
<body>
<%


	User user = (User)session.getAttribute("user");
	if(user != null){

		String path = this.getServletConfig().getServletContext().getRealPath("");
		String fileName = request.getParameter("fileName");
		String size = request.getParameter("size");
		session.setAttribute("fileName", fileName);
		session.setAttribute("size", size);
		PriceForMaterialsManager p4m = new PriceForMaterialsManager();
		List<PriceForMaterials> p4mList = p4m.fetchPriceFromDB();
	%> 
<div id="header">
					<ul>
						<li><a href="#" class="first">Moje konto</a></li>
						<li><a href="#" class="second_selected">Wgraj pliki</a></li>
						<li><a href="#" class="third">Potwierdź dane</a></li>	
					</ul>
				</div>
				<div id="content">	
	<form action="OrderAction" method="post" >
		<input type="hidden" name="fileName" value="<%= fileName%>" />
		<table>

			<tr>
				<td class="first">Wybierz materiał:</td>
				<td>
					<select name="material" style="width: 250px; height: 25px;">
						<% for(PriceForMaterials material : p4mList){ %>
						<option><%= material.getTypeOfMaterial() %></option>
						<% } %>
				</select>
				</td>
			</tr>
			<tr>
				<td class="first">Ilość kopii:</td>
				<td>
					<input type="text" name="copies" style="width: 250px; height: 25px;" value="1"/>
				</td>
			</tr>
			<tr>
				<td class="first">Priorytet:</td>
				<td>
					<select name="priority" style="width: 250px; height: 25px;" >
						<option>Wysoki</option>
						<option selected>Normalny</option>
						<option>Niski</option>
				</select>
				</td>
			</tr>
			<tr>
				<td class="first">Uwagi:</td>
				<td>
					<textarea name="uwagi" style="width: 250px; height: 25px;"></textarea>
<!-- 					<input type="text" name="uwagi" style="width: 250px; height: 25px;"/> -->
				</td>
			</tr>
			<tr>
				<td colspan="2" style="height: 20px"></td>
				
			</tr>
			<tr>
				<td>
					<button class="classname" type="submit">OK</button>
				</td>
			</tr>
		</table>
	</center>
	</form>
	</div>
	 <div id="content">
 Masz problem ze złożeniem zamówienia? Napisz do nas: <a href="mailto:biuro@mocnydruk.pl">biuro@mocnydruk.pl</a>
 </div>
</body>
</html>

<%
			}
		else{
		response.sendError(404,"Drukarnia: brak uprawnien");
			}
	%>